class Product:
    def __init__(self, name, price):
        self.name = name
        self.price = price

    def __str__(self):
        return f"Product: {self.name}, Price: {self.price}"

    def add_car(self, cart):
        cart.add_product(self)


class ShoppingCart:
    def __init__(self):
        self.products = []

    def add_product(self, product):
        self.products.append(product)

    def show_products(self):
        for product in self.products:
            print(product)


if __name__ == '__main__':

    # 创建商品对象
    product1 = Product("Apple", 5.0)
    product2 = Product("Banana", 3.0)
    product3 = Product("Orange", 4.0)

    # 创建购物车对象
    cart = ShoppingCart()

    # 添加商品到购物车
    product1.add_car(cart)
    product2.add_car(cart)
    product3.add_car(cart)

    # 显示购物车中的商品信息
    print("Shopping Cart:")
    cart.show_products()